package com.cloud.lawcase.api.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.lawcase.api.bean.LawCriteriaBean;
import com.cloud.lawcase.api.entity.TcDicLaw;
import com.cloud.lawcase.api.service.LawService;
import com.cloud.lawcase.common.result.Quokka;

import springfox.documentation.annotations.ApiIgnore;
@ApiIgnore
@RestController
@RequestMapping("lawcase/api/law")
public class LawController {

	@Autowired
	private LawService lawService;

	@RequestMapping("listpage")
	public Quokka listLaw(@RequestBody LawCriteriaBean criteria) {
		return new Quokka(true, lawService.listLawPage(criteria));
	}

	@RequestMapping("detail")
	public Quokka loadLawDetail(Long id) {
		return new Quokka(true, lawService.loadLawDetail(id));
	}

	@RequestMapping("saveupdate")
	public Quokka saveUpdateLaw(@RequestBody TcDicLaw law) {
		return new Quokka(true, lawService.saveUpdateLaw(law));
	}

	@RequestMapping("delete")
	public Quokka deleteLaw(Long id) {
		return new Quokka(true, lawService.deleteLaw(id));
	}

	@RequestMapping("lawStat")
	public Quokka listStatPage(Long id) {
		return new Quokka(true, lawService.lawStat(id));
	}

	@RequestMapping("lawExecuteTypeStat")
	public Quokka lawExecuteTypeStat(Long id) {
		return new Quokka(true, lawService.lawExecuteTypeStat(id));
	}

	@RequestMapping("getdetail")
	public Quokka getDetail(String code) {
		return new Quokka(true, lawService.getDetail(code));
	}
}
